package com.shangxia.product.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shangxia.feign.client.UserClient;
import com.shangxia.feign.model.SX_Product;
import com.shangxia.product.mapper.ProductMapper;
import com.shangxia.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * @author zhouya38158
 * @Package com.shangxia.user.service.impl
 * @date 2021/11/2 14:46
 */
@Service("userService")
public class ProductServiceImpl extends ServiceImpl<ProductMapper, SX_Product> implements ProductService {

    @Resource
    private ProductMapper productMapper;

    @Autowired
    private UserClient userClient;

    @Override
    public SX_Product queryById(Long id) {
        SX_Product product = productMapper.selectById(id);

        return product;
    }

    @Override
    public List<SX_Product> listByIds(String ids) {
        return productMapper.selectBatchIds(Arrays.asList(ids.split(",")));
    }

    @Override
    public List<SX_Product> listByListIds(List<Long> ids) {
        return productMapper.selectBatchIds(ids);
    }
}
